﻿using System.EnterpriseServices;
using System.Linq;
using System.Web.Services;
using Nomad.WebSync.Service.DAO;
using System.Web.Services.Protocols;

namespace Nomad.WebSync.Service {
    public partial class Mobile {
        [SoapHeader("Header"), WebMethod()]
        public Appointment[] GetAppointments() {
            this.Authentication();
            return Appointment.ListByAccount(Header.Username);
        }

        [SoapHeader("Header"), WebMethod()]
        public void UpdateAppointment(Appointment appointment) {
            this.Authentication();
            appointment.Synchronize(Header.Username);
        }

        [SoapHeader("Header"), WebMethod()]
        public void RemoveAppointment(Appointment appointment) {
            this.Authentication();
            appointment.Remove();
        }
    }
}
